<?php

require_once 'Ext/Account/Abstract.php';

class Ext_Account_Adapter_Ucenter extends Ext_Account_Abstract
{
    public function _build()
    {
        $userProfile = App_Model_DbTable_User_Profile::getInstance()->getRowByUserId($this->_userId);
        if(!isset($userProfile['username']) || $userProfile['username'] == '')
        {
            return "";
        }
        $username = $userProfile['username'];

        $ucenter = new Ext_Ucenter();
        $ucenterResult = $ucenter->show($username);
        if(!$ucenterResult)
        {
            return "";
        }

        list($uid, $username, $email) = $ucenterResult;
        if($uid < 1){
            return "";
        }
        $this->username = $username;
        $this->email    = $email;
    }
    
}
